﻿namespace OasisCiq.Xpil
{
    using System.Collections.Specialized;
    using CommonTypes;
    using External;
    using XS;

    /// <summary>
    /// Type of event for a person - e.g. marriage anniversary, death, 
    /// daughter's birth, spouse birthday, etc. 
    /// Type of event for organisation - date of formation/registration, date of closing down, 
    /// date of liquidation, data of becoming public limited, etc
    /// </summary>
    public class Event : CTString, IValidityDateGroup, IDataQualityGroup, IExtendedAttributes
    {
        public Event(string value)
            : base(value)
        {
        }

        /// <summary>
        /// Type of event. e.g. Anniversary. If "Anniversary" is type, 
        /// then the text for Event could be "20th wedding anniversary"
        /// </summary>
        public EventTypeList Type { get; set; }

        /// <summary>
        /// Could be start date, issue date, validity start date, etc
        /// </summary>
        public XSDateTime DateValidFrom { get; set; }

        /// <summary>
        /// Could be end date, expiry date, validity end date, etc
        /// </summary>
        public XSDateTime DateValidTo { get; set; }

        /// <summary>
        /// Record the exact date of the event here. For example, deceased 
        /// date, company closed date, birthday date of spouse, etc
        /// </summary>
        public XSDateTime Date { get; set; }

        /// <summary>
        /// This attribute indicates what level of trust can be given to the parent element.
        /// Omit this attribute if the data quality is unknown. If the data quality is known,
        /// the value is "Valid, else "InValid"
        /// </summary>
        public DataQualityTypeList DataQualityType { get; set; }

        /// <summary>
        /// Date the data quality is valid from
        /// </summary>
        public XSDateTime ValidFrom { get; set; }

        /// <summary>
        /// Date the data quality is valid to
        /// </summary>
        public XSDateTime ValidTo { get; set; }

        public NameValueCollection ExtendedAttributes { get; set; }
    }
}
